﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DP.AbstractFactory
{
    class Program
    {
        static void Main(string[] args)
        {
            //工厂类
            WorkerFactory wf = new WorkerFactory();
            //获取实现接口的类，通过返回该接口类型的抽象工厂内的方法；
            IWork awork= wf.CreateAmericanWork();
            //使用对象；
            awork.MakeProduct();
            Console.WriteLine("**************************************");
            IWork cwork = wf.CreateChineseWork();
            cwork.MakeProduct();
            Console.WriteLine("**************************************");
            IWork jwork = wf.CreateJanpaneseWork();
            jwork.MakeProduct();
            Console.WriteLine("**************************************");
            IWork gwork = wf.CreateGermanWork();
            gwork.MakeProduct();
            Console.WriteLine("**************************************");
            Console.ReadKey();
        }
    }
}
